Skip to content

Reflow drawn setting choices instead of clipping their labels - #79

Merged
marcosqlbi merged 2 commits into
mainfrom
fix/preferences-sample-choice-width
Aug 29, 2026
Merged

Reflow drawn setting choices instead of clipping their labels#79
marcosqlbi merged 2 commits into
mainfrom
fix/preferences-sample-choice-width

Conversation

@marcosqlbi

Copy link
Copy Markdown
Collaborator

The drawn choices added in #73 — Pen button, Toolbar position, Toolbar layout —
were clipped when the Preferences dialog was narrowed. Toolbar / Position is the
one that showed it: five options in a row, and at the dialog's 560 px minimum
each segment holds about 52 px inside its padding, against the ~44 px "Bottom"
needs. A word too long for its line overflows and is clipped rather than wrapped,
and TextTrimming does not help because it applies only when the height is
constrained — so the label read as a different word, "Bottor right".

The row reflows

The choices now sit in a small panel that measures and arranges its own children,
taking its column count from the width the row actually occupies. Five choices
stay in one row when there is room and fall to 4+1 and then 3+2 as the dialog
narrows, rather than shrinking past legibility.

Two earlier attempts are worth recording, because both looked right and neither
was. Recomputing on SizeChanged only fires when the width changes, so the count
settled during the first layout pass stood for the life of the dialog. Moving it
to MeasureOverride fixed the staleness but not the cause: the width a row is
measured against arrives far narrower than the width it is finally given, so the
count was still computed against a width the row never had. ArrangeOverride has
the real width, and that is what it now reads.

The samples scale

Each sample is wrapped in a down-only Viewbox, so it draws at its designed size
when there is room and shrinks with the column instead of overflowing and losing
its edges. The segment template honours HorizontalContentAlignment so the label
is given the width it is measured against, and the padding drops from 10,12 to
6,12.

Version 1.1.4. Release build clean with TreatWarningsAsErrors, smoke tests pass.

🤖 Generated with Claude Code

marcosqlbi and others added 2 commits August 29, 2026 19:18
Toolbar / Position puts five drawn choices in one row. At the dialog's
560px minimum the content column is about 330px, so each segment holds
roughly 52px inside its padding - less than the 44px "Bottom" needs once
the border is taken out. A word too long for its line overflows and is
clipped rather than wrapped, and TextTrimming does not help because it
applies only when the height is constrained, so the label read as a
different word: "Bottor right".

The UniformGrid now recomputes its column count from its own width
against the width at which a segment can hold that word. Five choices
stay on one row at the default size and take a second row as the dialog
narrows. Settings with two or three choices never reach the floor.

The sample itself is wrapped in a down-only Viewbox, so it scales with
the column rather than overflowing and losing its edges, and the segment
template now honours HorizontalContentAlignment so the label is given
the width it is being measured against.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The column count was settled from the width the row was measured
against, which in this dialog arrives far narrower than the width the
row is finally given. Five choices therefore sat on three columns in a
row with room for all five, and stayed there: the count was computed
once and nothing recomputed it as the dialog was resized.

The row is now a plain panel that measures and arranges its own
children, taking the count from the width it actually occupies in
ArrangeOverride and measuring the children again when that disagrees
with what MeasureOverride assumed. Five choices sit in one row when
there is room, and fall to 4+1 and then 3+2 as the dialog narrows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@marcosqlbi
marcosqlbi merged commit bbbb82f into main Aug 29, 2026
4 checks passed
@marcosqlbi
marcosqlbi deleted the fix/preferences-sample-choice-width branch August 29, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant